# -*- coding: utf-8 -*-
"""
@Time    : 2022/11/5 23:33
@Author  : JackXia
@Email   : 915624876@qq.com
@QQ      : 915624876
@File    : 栈stack.py
@Software: PyCharm
"""

from pythonds.basic import Stack


class Stack:
    def __init__(self):
        self.items = []

    def isEmpty(self):
        return self.items == []

    def push(self, item):
        self.items.append(item)

    def pop(self):
        return self.items.pop()

    def peek(self):
        return self.items[-1]

    def size(self):
        return len(self.items)


def match(s):
    stack = Stack()
    for i in s:
        stack.push(i)

    return stack.isEmpty()


if __name__ == '__main__':
    s = '()()()()()()'
